package com.ronipl.createtabs;

import android.content.Context;
import android.os.Vibrator;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemSelectedListener;

public class CustomOnItemSpinnerSelectedListener implements
		OnItemSelectedListener {

	@Override
	public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
		
		if(pos == 0){
			
		}else if(pos == 1){
			Toast.makeText(parent.getContext(), "Leave request form", Toast.LENGTH_SHORT).show();
			
			Vibrator v = (Vibrator) parent.getContext().getSystemService(Context.VIBRATOR_SERVICE);
			 // Vibrate for 500 milliseconds
			 v.vibrate(2000);
			
		}else if(pos == 2){
			Toast.makeText(parent.getContext(), "Maintenance form", Toast.LENGTH_SHORT).show();
			//Vibrator v = (Vibrator) parent.getContext().getSystemService(Context.VIBRATOR_SERVICE);
			 // Vibrate for 500 milliseconds
			 //v.vibrate(2000);
			 
		}else if(pos == 3){
			Toast.makeText(parent.getContext(), "Other form", Toast.LENGTH_SHORT).show();
			//Vibrator v = (Vibrator) parent.getContext().getSystemService(Context.VIBRATOR_SERVICE);
			 // Vibrate for 500 milliseconds
			 //v.vibrate(2000);
		}
		
	}

	@Override
	public void onNothingSelected(AdapterView<?> arg0) {
		

	}

}
